home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1993…ch: Other People's Memory / ADC Developer CD (1993-03) (''Other People's Memory'')_iso / Dev.CD Mar 93.iso / Development Platforms / CSMP Digests / csmp-v1-035.txt < prev    next >
Encoding:
Text File  |  1992-11-18  |  42.6 KB  |  1,199 lines  |  [TEXT/MPS ]

  1. C.S.M.P. Digest             Sun, 29 Mar 92       Volume 1 : Issue 35
  2.  
  3. Today's Topics:
  4.  
  5.     subclassing TWindow (was Re: Closing windows in MacApp)
  6.     limit to resource file size?
  7.     MacApp 3.0 and the book "C++ Programming with MacApp"
  8.     Responder
  9.     Mac C++
  10.     copying a resource
  11.     How do you get SFGetFile() to show *.sic only
  12.     How to store data record in file that grows dynamically?
  13.  
  14.  
  15. The Comp.Sys.Mac.Programmer Digest is moderated by Michael A. Kelly.
  16.  
  17. These digests are available (by using FTP, account anonymous, your email
  18. address as password) in the pub/mac/csmp-digest directory on ftp.cs.uoregon.
  19. edu.  This is also the home of the comp.sys.mac.programmer Frequently Asked
  20. Questions list.
  21.  
  22. These digests are also available via email.  Just send a note saying that you
  23. want to be on the digest mailing list to mkelly@cs.uoregon.edu, and you will
  24. automatically receive each new digest as it is created.
  25.  
  26. The articles in these digests are taken directly from comp.sys.mac.programmer.
  27. They are not edited; all articles included in this digest are in their original
  28. posted form.  The only articles that are -not- included in these digests are
  29. those which didn't receive any replies (except those that give information
  30. rather than ask a question).  All replies to each article are concatenated
  31. onto the original article in the order in which they were received.  Article
  32. threads are not added to the digests until the last article added to the
  33. thread is at least one month old (this is to ensure that the thread is dead
  34. before adding it to the digests).
  35.  
  36. Send administrative mail to mkelly@cs.uoregon.edu.
  37.  
  38. -------------------------------------------------------
  39.  
  40. From: mlanett@void.ncsa.uiuc.edu (Mark Lanett)
  41. Subject: subclassing TWindow (was Re: Closing windows in MacApp)
  42. Organization: University of Illinois at Urbana
  43. Date: Tue, 25 Feb 1992 06:17:24 GMT
  44.  
  45. keith@Apple.COM (Keith Rollin) writes:
  46.  
  47. >In article <kaas.698564808@vincent1.iastate.edu> kaas@iastate.edu (Gerald E Kaas) writes:
  48. >>I was wondering if there was a way to detect if the user has closed a window
  49. >>that I opened without overriding TWindow or a TView.
  50.  
  51. >Mark Lannett has posted some handy tips here, but I just wanted to ask
  52. >a follow-up question: What's wrong with sub-classing TWindow? From my
  53. >memory of MacApp and from the way you ask your question, it seems that
  54. >sub-classing TWindow is the right thing. If so, why don't you want to
  55. >do that?
  56.  
  57. Nasty, nasty, nasty. I've had too many situation where I've had/wanted to 
  58. subclass TWindow, and you can only subclass it once. For instance: I have *way*
  59. too many menus and need to have them appear only when the appropriate window
  60. is in front. How to do this? Subclass TWindow and have it put up/take down the
  61. window when it gets Activate true/false events*. But... In other cases I want
  62. the window to resize to fit the data it holds. So here's another TWindow 
  63. subclass with a FitToData routine. Of course neither of these work with floating
  64. windows, so I have to create equivalent subclasses of TFloatWindow *also*.
  65.  
  66. Subclassing TWindow causes too many problems; it's much better to stay clear.
  67.  
  68. *Of course the (in)famous Mac Toolbox "I don't queue Activate events" bug
  69. crops up here: If a window is open (window A) and someone takes an action 
  70. causing a document to be created which has TWO windows (B and C) then:
  71. B opens, generating a deactivate for A and an activate for itself. Then C
  72. opens, generating a deactivate for B and an activate for itself (C). Bit
  73. these aren't queued, so A's deactivate and B's activate are lost, with the
  74. result that A gets NO deactivate (why's that menu STILL in the menu bar?),
  75. B gets a deactivate WITHOUT having gotten an activate, and C actually does
  76. gets its activate. Wonderfull. I modified TWindow::Show to call
  77. gApplication->PollToolboxEvent(false) to collect the stupid activates before
  78. they get lost but that caused a mess in and of itself so I gave up on using
  79. TWindow for the job.
  80.  
  81. What MacApp *really* needs is a way to inform everyone in the target chain --
  82. not just the actual target -- when they're entering and leaving. This way
  83. my document can take care of putting up and taking down the menus, or maybe
  84. a view or view behavior can do it rather than TWindow. In fact I've already
  85. put this into my version of MacApp and it works to the extent that MacApp 3.0
  86. targeting works (which is better than the Toolbox's queuing of activates, but
  87. not much). I suppose I should mail the MacApp 3 group and try to get them to
  88. put it in the real version...
  89.  
  90.  
  91.  
  92. An amusing and unrelated note: Some time back I posted a ProgressDialog class
  93. to the net. I received almost no feedback and so forgot about it. So imagine
  94. my surprise when reading the ObjectMaster review in FrameWorks and seeing
  95. my ProgressDialog in an ObjectMaster view class window! Well, at least
  96. someone is using it, though I never expected to find out that way. Does this
  97. mean I've been published :-)?
  98. -- 
  99. Mark Lanett                                                   mlanett@uiuc.edu
  100. Software Tools Group, NCSA, University of Illinois at Urbana-Champaign
  101.  
  102.  
  103.  
  104. ---------------------------
  105.  
  106. From: janee@ima.isc.com (Jane Eisenstein)
  107. Subject: limit to resource file size?
  108. Date: 28 Jan 92 15:09:09 GMT
  109. Organization: Interactive Systems, Cambridge, MA 02138-5302
  110.  
  111. I'm running into trouble creating large resource files.  I'm dealing
  112. with large chunks of data as purgeable resources written to a
  113. temporary file.  It seems that if the file becomes too large it
  114. becomes corrupted.  This appears to consistently happen as the file
  115. grows from 13MB to 17MB.  I'm aware that there is a limit to the
  116. number of resources in a file.  Is there a limit to the total size of
  117. the resource fork?
  118.  
  119.     Jane Eisenstein
  120.     janee@ima.isc.com
  121.  
  122.  
  123.  
  124. - -------------------------
  125.  
  126. From: keith@Apple.COM (Keith Rollin)
  127. Subject:  limit to resource file size?
  128. Date: 28 Jan 92 23:47:14 GMT
  129. Organization: Apple Computer Inc., Cupertino, CA
  130.  
  131. In article <1992Jan28.150909.16199@ima.isc.com> janee@ima.isc.com (Jane Eisenstein) writes:
  132. >I'm running into trouble creating large resource files.  I'm dealing
  133. >with large chunks of data as purgeable resources written to a
  134. >temporary file.  It seems that if the file becomes too large it
  135. >becomes corrupted.  This appears to consistently happen as the file
  136. >grows from 13MB to 17MB.  I'm aware that there is a limit to the
  137. >number of resources in a file.  Is there a limit to the total size of
  138. >the resource fork?
  139.  
  140. Yep, and its around 16Meg. The reason for this is because the resource
  141. fork format uses 24-bit offsets internally. Take a look at the latter
  142. part of Chapter 5 of IM I to see this.
  143.  
  144. -- 
  145. - ----------------------------------------------------------------------------
  146. Keith Rollin           ---            <Taligent .signature under construction>
  147. Disclaimer: Pretty soon, I really _won't_ be speaking for Apple...
  148.  
  149.  
  150.  
  151. - -------------------------
  152.  
  153. From: wysocki@husc.harvard.edu (Chris Wysocki)
  154. Subject:  limit to resource file size?
  155. Date: 28 Jan 92 23:12:38 GMT
  156. Organization: Harvard University, Cambridge, MA
  157.  
  158. In article <1992Jan28.150909.16199@ima.isc.com>, janee@ima.isc.com (Jane
  159. Eisenstein) writes:
  160.  
  161. > I'm running into trouble creating large resource files.  I'm dealing
  162. > with large chunks of data as purgeable resources written to a
  163. > temporary file.  It seems that if the file becomes too large it
  164. > becomes corrupted.  This appears to consistently happen as the file
  165. > grows from 13MB to 17MB.  I'm aware that there is a limit to the
  166. > number of resources in a file.  Is there a limit to the total size of
  167. > the resource fork?
  168.  
  169. Resource files are limited to 16 MB, since offsets in the resource map are
  170. only 24 bits long; see IM I-130.
  171.  
  172. Chris Wysocki
  173. wysocki@husc.harvard.edu
  174.  
  175.  
  176.  
  177. - -------------------------
  178.  
  179. From: Greg@AppleLink.Apple.Com (Greg Marriott)
  180. Subject:  limit to resource file size?
  181. Date: 31 Jan 92 01:28:09 GMT
  182. Organization: Apple Computer, Inc.
  183.  
  184. In article <1992Jan28.150909.16199@ima.isc.com>, janee@ima.isc.com (Jane Eisenstein) writes:
  185. > [...] as the file grows from 13MB to 17MB. [...] Is there a limit to the total
  186. > size of the resource fork?
  187.  
  188. Yes.  The limit is 16MB.  Offsets in the resource map are 24 bits long, which
  189. makes the maximum offset 16MB.
  190.  
  191. Greg Marriott
  192. Blue Meanie
  193. Apple Computer, Inc.
  194.  
  195.  
  196.  
  197. - -------------------------
  198.  
  199. From: keith@Apple.COM (Keith Rollin)
  200. Subject:  limit to resource file size?
  201. Date: 28 Jan 92 23:47:14 GMT
  202. Organization: Apple Computer Inc., Cupertino, CA
  203.  
  204. In article <1992Jan28.150909.16199@ima.isc.com> janee@ima.isc.com (Jane Eisenstein) writes:
  205. >I'm running into trouble creating large resource files.  I'm dealing
  206. >with large chunks of data as purgeable resources written to a
  207. >temporary file.  It seems that if the file becomes too large it
  208. >becomes corrupted.  This appears to consistently happen as the file
  209. >grows from 13MB to 17MB.  I'm aware that there is a limit to the
  210. >number of resources in a file.  Is there a limit to the total size of
  211. >the resource fork?
  212.  
  213. Yep, and its around 16Meg. The reason for this is because the resource
  214. fork format uses 24-bit offsets internally. Take a look at the latter
  215. part of Chapter 5 of IM I to see this.
  216.  
  217. -- 
  218. - ----------------------------------------------------------------------------
  219. Keith Rollin           ---            <Taligent .signature under construction>
  220. Disclaimer: Pretty soon, I really _won't_ be speaking for Apple...
  221.  
  222.  
  223.  
  224. - -------------------------
  225.  
  226. From: Greg@AppleLink.Apple.Com (Greg Marriott)
  227. Subject:  limit to resource file size?
  228. Date: 31 Jan 92 01:28:09 GMT
  229. Organization: Apple Computer, Inc.
  230.  
  231. In article <1992Jan28.150909.16199@ima.isc.com>, janee@ima.isc.com (Jane Eisenstein) writes:
  232. > [...] as the file grows from 13MB to 17MB. [...] Is there a limit to the total
  233. > size of the resource fork?
  234.  
  235. Yes.  The limit is 16MB.  Offsets in the resource map are 24 bits long, which
  236. makes the maximum offset 16MB.
  237.  
  238. Greg Marriott
  239. Blue Meanie
  240. Apple Computer, Inc.
  241.  
  242.  
  243.  
  244. ---------------------------
  245.  
  246. From: quesnel@ems (Rene Quesnel)
  247. Subject: MacApp 3.0 and the book "C++ Programming with MacApp"
  248. Date: 17 Feb 92 13:50:31 GMT
  249. Organization: Faculty of Music, McGill University
  250.  
  251. I recently bought the book "C++ Programming with MacApp" by Wilson,
  252. Rosenstein, and Shaffer. Then I read in the news that MacApp 3.0
  253. was rewritten in C++ and that hierarchies of classes were modified
  254. (I don't know to what extent). It this book still worth reading for
  255. someone who wants to learn how to program with MacApp 3.0?
  256.  
  257. Thanks,
  258.  
  259. Rene Quesnel
  260. quesnel@music.mcgill.ca
  261.  
  262.  
  263.  
  264. - -------------------------
  265.  
  266. From: ksand@apple.com (Kent Sandvik)
  267. Subject:  MacApp 3.0 and the book "C++ Programming with MacApp"
  268. Date: 20 Feb 92 01:03:41 GMT
  269. Organization: MacDTS Mongols
  270.  
  271. In article <1992Feb17.135031.15093@thunder.mcrcim.mcgill.edu>, quesnel@ems (Rene Quesnel) writes:
  272. > I recently bought the book "C++ Programming with MacApp" by Wilson,
  273. > Rosenstein, and Shaffer. Then I read in the news that MacApp 3.0
  274. > was rewritten in C++ and that hierarchies of classes were modified
  275. > (I don't know to what extent). It this book still worth reading for
  276. > someone who wants to learn how to program with MacApp 3.0?
  277.  
  278. It is true that the book has samples based on MacApp 2.0. However I would
  279. purchase the book, because it gives a good overall insight into the world
  280. of MacApp and OOP programming. And it's not hard to translate the information
  281. over to the new APIs in MacApp 3.0.
  282.  
  283. Kent Sandvik/DTS
  284.  
  285.  
  286.  
  287. - -------------------------
  288.  
  289. From: michael@otago.ac.nz
  290. Subject:  MacApp3 & C++
  291. Date: 25 Feb 92 22:54:07 GMT
  292. Organization: University of Otago, Dunedin, New Zealand
  293.  
  294. In article <63170@apple.Apple.COM>, keith@Apple.COM (Keith Rollin) writes:
  295.  
  296. > MacApp 3.0 is written entirely in C++, and will most likely stay that
  297. > way. This means that if the pre-compiled libraries that come with
  298. > MacApp are not sufficient for you and you need to compile your own
  299. > version, you will need C++. However, you can still write your own code
  300. > in MPW Pascal if you want; it will link with MacApp just fine.
  301.  
  302. This is indeed good news: I was getting discouraged about upgrading to 3.0
  303. because of the cost of buying C and C++. However, am I correct in thinking that
  304. a reading knowledge of C++ is going to be necessary because we still
  305. occasionally have to read the source code to find out what MacApp is doing?
  306.  
  307. Michael(tm) Hamel, Computing Services Centre, University of Otago, New Zealand
  308.  
  309. SCULLET (n.)                       
  310. The last teaspoon in the washing up.
  311.  
  312.  
  313.  
  314. - -------------------------
  315.  
  316. From: mcmath@csb1.nlm.nih.gov (Chuck McMath)
  317. Subject:  MacApp3 & C++
  318. Date: 26 Feb 92 13:11:51 GMT
  319. Organization: MSD
  320.  
  321. In article <1992Feb26.115407.2225@otago.ac.nz>, michael@otago.ac.nz writes:
  322. > >    (stuff about not needing C++ to program in MacApp)
  323. >
  324. > This is indeed good news: I was getting discouraged about upgrading to 3.0
  325. > because of the cost of buying C and C++. However, am I correct in thinking that
  326. > a reading knowledge of C++ is going to be necessary because we still
  327. > occasionally have to read the source code to find out what MacApp is doing?
  328. > Michael(tm) Hamel, Computing Services Centre, University of Otago, New Zealand
  329. > SCULLET (n.)                       
  330. > The last teaspoon in the washing up.
  331.  
  332. While it's true you don't ABSOLUTELY need C++ to work with MacApp, you will
  333. need to have all the library permutations you need pre-built, since you
  334. wouldn't be able to -Autobuild them as needed.  In addition, this obviously
  335. means you can't tweak with the MacApp source code to fix bugs (which happens
  336. once in a while).  The cost to buy all the pieces is quite a lot, but it seems
  337. a necessary expense.
  338.  
  339. You do need a reading knowledge of C++ to understand what's going on.  In
  340. my experience the only problem you might have is in adjusting to iteration
  341. over TLists and the like.  MacApp 3.0 uses iterators, which looks confusing
  342. but is not too difficult to get used to.
  343.  
  344. chuck
  345.  
  346.                        --chuck mcmath-
  347.                     mcmath@csb1.nlm.nih.gov
  348.   MSD, Inc. * National Library of Medicine * National Institutes of Health
  349.                        Bethesda, MD 20894
  350.  
  351.  
  352.  
  353. - -------------------------
  354.  
  355. From: u_banzai@mcl.mcl.ucsb.edu (Buckaroo Banzai)
  356. Subject:  MacApp3 & C++
  357. Date: 28 Feb 92 00:15:34 GMT
  358.  
  359. So, when IS MacApp 3.0 coming out??????
  360.  
  361. Anyone know?
  362.  
  363. --
  364. =  Marc Tamsky    u_banzai@mcl.ucsb.edu    2121dtam@ucsbuxa.ucsb.edu  KB6JWE =
  365.  
  366.  
  367.  
  368. - -------------------------
  369.  
  370. From: anders@verity.com (Anders Wallgren)
  371. Subject:  MPW questions
  372. Organization: Verity, Inc., Mountain View, CA
  373. Date: Thu, 27 Feb 92 21:24:00 GMT
  374.  
  375. In article <33784@nntpd.lkg.dec.com>, long@mcntsh (Rich Long) writes:
  376. >
  377. > I'm new to MPW (3.2), so I'd appreciate some help with some weird things I
  378. > can't figure out.
  379. >
  380. > 1. How do I tell the Find command to look for a tab character?
  381.  
  382.  
  383. find /<opt-d>t/ "the window" # <opt-d> means press option-d
  384.  
  385. >
  386. > 3. What would be the script syntax for walking a directory and extracting the
  387. > file name portion of the path? For example, if I have a
  388. > "RCL:this:that:something else" path, and want the "something else" name into
  389. > a variable, how could I do this?
  390. >
  391.  
  392. if "foo:bar:something else" =~ /[a-zA-Z:_0-9]<opt-x>:([a-zA-Z_0-9]<opt-x>)<opt-r>1/ 
  393.     set variable "{<opt-r>1}"
  394. end
  395.  
  396.  
  397.  
  398.  
  399. ---------------------------
  400.  
  401. From: liran@bimacs.BITNET (Eshel Liran)
  402. Subject: Responder
  403. Date: 17 Feb 92 13:40:52 GMT
  404. Organization: Math & CS, BarIlan U, Ramat-Gan, Israel
  405.  
  406. 1st Question:
  407. - ----------
  408. Is it possible to identify the responder's socket ?
  409. Is there something unique about its address or its EntityName ?
  410.  
  411. If there is nothing else i wil just have to compare the ObjStr with the
  412. computer names strings (that's what i want to avoid).
  413.  
  414. 2nd Question:
  415. - ----------
  416. What's the latest version of responder ?
  417. The one i have doesn't know the new macs (LC,SI,Classic).
  418.  
  419. ...........................................................................
  420. Liran Eshel
  421. Bar-Ilan University
  422. Ramat-Gan, ISRAEL
  423. liran@bimacs.cs.biu.ac.il
  424.  
  425.  
  426.  
  427. - -------------------------
  428.  
  429. From: woody@ucscb.UCSC.EDU (Bill Woodcock)
  430. Subject:  Responder
  431. Date: 17 Feb 92 18:49:34 GMT
  432. Organization: University of California, Santa Cruz
  433.  
  434.  
  435.  
  436.         > liran@bimacs.BITNET (Eshel Liran) writes:
  437.         > Is it possible to identify the responder's socket ?
  438.         > Is there something unique about its address or its EntityName ?
  439.     
  440.     Well, on my own network here, all the Responders are using socket 253.
  441.     In all likelyhood, that's just coincidence.  They probably just go for
  442.     the higest unused socket they can find. Also, if you hit them with  an
  443.     ATP ALO transaction request with data "00 00 00 01" they spit back one
  444.     end-of-message transaction response full of gestalt calls or whatever.
  445.     
  446.         > What's the latest version of responder ?
  447.         > The one i have doesn't know the new macs (LC,SI,Classic).
  448.     
  449.     The most recent version I see here is Responder 201.    Keep  in  mind
  450.     that Responder is now built into the System file under System 7.x.  It
  451.     also has a  "feature"  which  allows  people  to  crash  your  machine
  452.     remotely, which makes it particularly annoying that it's now harder to
  453.     remove.
  454.  
  455.     Disclaimer: I'm not a programmer, so I probably don't  know  what  I'm
  456.     talking about, anyhow.  :-)
  457.     
  458.                                 -Bill Woodcock
  459.                     
  460. ________________________________________________________________________________
  461. bill.woodcock.iv..woody@ucscb.ucsc.edu..2355.virginia.st..berkeley.ca.94709.1315
  462.  
  463.  
  464.  
  465. - -------------------------
  466.  
  467. From: cremer@apple.com ($mike cremer)
  468. Subject:  Responder
  469. Date: 23 Feb 92 23:44:52 GMT
  470. Organization: apple computer, inc.
  471.  
  472. In article <28752@darkstar.ucsc.edu>, woody@ucscb.UCSC.EDU (Bill Woodcock) writes:
  473.  
  474. >    >   [ questions about Responder ]
  475. >     
  476. >     Well, on my own network here, all the Responders are using socket 253.
  477. >     In all likelyhood, that's just coincidence.  They probably just go for
  478. >     the higest unused socket they can find.
  479.  
  480. Actually, it opens a dynamic ATP socket.  The code for opening a dynamic
  481. socket goes for the first "unused" socket number, starting at the top.
  482. It is pure coincidence that all appear to have the same socket.
  483.  
  484. >     Also, if you hit them with  an
  485. >     ATP ALO transaction request with data "00 00 00 01" they spit back one
  486. >     end-of-message transaction response full of gestalt calls or whatever.
  487.  
  488. Responder uses an un-published protocol to return system information.
  489. Apple hasn't published the protocol because they intend to replace it
  490. with something better and more reliable. DO NOT rely on either
  491. the transport or the data, as it will likely change.
  492.  
  493. >    The most recent version I see here is Responder 201.    Keep  in  mind
  494. >    that Responder is now built into the System file under System 7.x.
  495.  
  496. The most recent version is Responder 2.0.3.  It is built into the stacks
  497. for 7.x, but AppleTalk v 57.0.1 includes the new INIT version for System
  498. 6.x.
  499.  
  500. >    It also has a  "feature"  which  allows  people  to  crash  your  machine
  501. >    remotely, which makes it particularly annoying that it's now harder to
  502. >    remove.
  503.  
  504. This bug was fixed as of Responder 2.0.1.  Try installing the latest
  505. Responder, using the Network Software Installer 1.1 (available via
  506. anonymous FTP from ftp.apple.com in the directory /dts/mac/sys.soft/netcomm/
  507. file net-soft-install-1-1-image.hqx).
  508.  
  509. $mike cremer
  510. cremer@apple.com
  511. disclaimers
  512.  
  513. To Get The Latest AppleTalk Stacks:
  514. Version: 57.0.1, for BOTH System 6.x and System 7.x
  515. Where: ftp.apple.com
  516. How: anonymous FTP
  517. directory: /dts/mac/sys.soft/netcomm/
  518. file: net-soft-install-1-1-image.hqx
  519.  
  520.  
  521.  
  522. ---------------------------
  523.  
  524. From: Thad.Humphries@p950.f70.n109.z1.FidoNet.Org (Thad Humphries)
  525. Subject: Mac C++
  526. Date: 18 Feb 92  20:28:00 EST
  527.  
  528. I know that both Apple and Zortech have C++ compilers for MPW.  But what version?  APDA says MPW C++ 3.1 but is that just to match the MPW version number?  SUN C++ version 2.1 is by AT&T (*that* should be current but templates and exceptions are reserved words not yet implemented) and Borland just released 3.0 (which has templates and exceptions).  
  529.  
  530. What's the story on the Mac?  Does Apple or Zortech support templates and/or exceptions yet?
  531.  
  532.  * Origin: Quis custodiet ipsos custodes? (1:109/70.950)
  533.  
  534.  
  535.  
  536. - -------------------------
  537.  
  538. From: neeri@iis.ethz.ch (Matthias Ulrich Neeracher)
  539. Subject:  Mac C++
  540. Date: 20 Feb 92 19:15:12 GMT
  541. Organization: Integrated Systems Laboratory, ETH, Zurich
  542.  
  543. In article <698562057.1@blkcat.FidoNet> Thad.Humphries@p950.f70.n109.z1.FidoNet.Org (Thad Humphries) writes:
  544. >I know that both Apple and Zortech have C++ compilers for MPW.  But what version?  APDA says MPW C++ 3.1 but is that just to match the MPW version number?  SUN C++ version 2.1 is by AT&T (*that* should be current but templates and exceptions are reserved words not yet implemented) and Borland just released 3.0 (which has templates and exceptions).  
  545. >
  546. >What's the story on the Mac?  Does Apple or Zortech support templates and/or exceptions yet?
  547.  
  548. Apple's C++ 3.x is really just the version number matched to MPW. It is
  549. actually based on CFront 2.1, I think. It doesn't support templates or
  550. exceptions. I don't know about Zortech.
  551.  
  552. Matthias
  553.  
  554. BTW, consider using the return key sometimes. It is probably located above your
  555. right shift key.
  556.  
  557. - ---
  558. Matthias Neeracher                                      neeri@iis.ethz.ch
  559.  `We say "gestalt" when things combine to act in ways we can't explain'
  560.                              -- Marvin Minsky, _The Society Of Mind_
  561.  
  562.  
  563.  
  564. - -------------------------
  565.  
  566. From: bbs.metalmac@tsoft.sf-bay.org (Tom Santos)
  567. Subject:  Mac C++
  568. Date: 20 Feb 92 11:37:39 GMT
  569. Organization: The TeleSoft BBS and Public Access Unix, +1 415 969 7958
  570.  
  571. Thad.Humphries@p950.f70.n109.z1.FidoNet.Org (Thad Humphries) writes:
  572.  
  573. > I know that both Apple and Zortech have C++ compilers for MPW.  But what vers
  574. > What's the story on the Mac?  Does Apple or Zortech support templates and/or 
  575.  
  576. Apple's C++ does not support any of that yet.  Apple is using 2.x right
  577. now.
  578. Zortech doesn't support it either as far as I know...
  579.  
  580. Tom
  581.  
  582. --
  583. Tom Santos (bbs.metalmac@tsoft.sf-bay.org)
  584.  
  585.  
  586.  
  587. - -------------------------
  588.  
  589. From: barczejj@ss2.wpafb.af.mil (Jeff J Barczewski 52824)
  590. Subject:  Mac C++
  591. Date: 20 Feb 92 20:32:25 GMT
  592. Organization: Air Force Institute of Technology
  593.  
  594. Thad.Humphries@p950.f70.n109.z1.FidoNet.Org (Thad Humphries) writes:
  595.  
  596. >I know that both Apple and Zortech have C++ compilers for MPW.  But what version?  APDA says MPW C++ 3.1 but is that just to match the MPW version number?  SUN C++ version 2.1 is by AT&T (*that* should be current but templates and exceptions are reserved words not yet implemented) and Borland just released 3.0 (which has templates and exceptions).  
  597.  
  598. >What's the story on the Mac?  Does Apple or Zortech support templates and/or exceptions yet?
  599.  
  600. Zortech C++ 3.1 is AT&T 2.0 with some 2.1. Unfortunately templates are
  601. not one of the 2.1 extentions.
  602.  
  603. > * Origin: Quis custodiet ipsos custodes? (1:109/70.950)
  604.  
  605.  
  606.  
  607. - -------------------------
  608.  
  609. From: Thad.Humphries@p950.f70.n109.z1.FidoNet.Org (Thad Humphries)
  610. Subject:  Mac C++
  611. Date: 21 Feb 92 00:27:02 GMT
  612.  
  613.  
  614.  MU> Apple's C++ 3.x is really just the version number matched to MPW. It is
  615.  MU> actually based on CFront 2.1, I think. It doesn't support templates or
  616.  MU> exceptions. I don't know about Zortech.
  617.  
  618. Thanks!  I was afraid of that.  Maybe by THINK C++ (dream on)!
  619.  
  620.  MU> BTW, consider using the return key sometimes. It is probably located above
  621.  MU> your
  622.  MU> right shift key.
  623.  
  624. My mail reader (MacWoof) has word wrap.  I can't speak for how yours interperts that but I never heard of a problem.  Fill me in and I'll pass it to the author, Craig Vaughan who lives in the area.
  625.  
  626.  * Origin: Quis custodiet ipsos custodes? (1:109/70.950)
  627.  
  628.  
  629.  
  630. - -------------------------
  631.  
  632. From: mlanett@void.ncsa.uiuc.edu (Mark Lanett)
  633. Subject:  Mac C++
  634. Organization: University of Illinois at Urbana
  635. Date: Sat, 22 Feb 1992 05:40:50 GMT
  636.  
  637. Thad.Humphries@p950.f70.n109.z1.FidoNet.Org (Thad Humphries) writes:
  638.  
  639. >My mail reader (MacWoof) has word wrap.  I can't speak for how yours interperts that but I never heard of a problem.  Fill me in and I'll pass it to the author, Craig Vaughan who lives in the area.
  640.  
  641. Your mail reader may have word wrap but a lot of gui-dead unix machines don't.
  642. -- 
  643. Mark Lanett                                                   mlanett@uiuc.edu
  644. Software Tools Group, NCSA, University of Illinois at Urbana-Champaign
  645.  
  646.  
  647.  
  648. - -------------------------
  649.  
  650. From: lsr@apple.com (Larry Rosenstein)
  651. Subject:  Mac C++
  652. Date: 25 Feb 92 02:44:44 GMT
  653.  
  654. In article <NEERI.92Feb20111512@iis.ethz.ch>, neeri@iis.ethz.ch (Matthias Ulrich
  655. Neeracher) writes:
  656. > Apple's C++ 3.x is really just the version number matched to MPW. It is
  657. > actually based on CFront 2.1, I think. It doesn't support templates or
  658. > exceptions. I don't know about Zortech.
  659.  
  660. I believe that MPW C++ 3.2 is based on AT&T CFront 2.1, and MPW C++ 3.1 is based
  661. on AT&T CFront 2.0.  In addition to bug fixes there are some differences in the
  662. way nested types are handled between the 2 versions.  
  663.  
  664. CFront 3.0 is the AT&T version that supports templates, but not exceptions.
  665. --
  666. Larry Rosenstein
  667. lsr@apple.com
  668.  
  669.  
  670.  
  671. ---------------------------
  672.  
  673. From: Daryl_Spitzer@mindlink.bc.ca (Daryl Spitzer)
  674. Subject: copying a resource
  675. Date: 20 Feb 92 20:59:11 GMT
  676. Organization: MIND LINK! - British Columbia, Canada
  677.  
  678. How can I copy a single resource from one file to another?
  679.  
  680. In particular, I want to my application to copy a resource (vers)
  681. from itself to a data file.  I've tried this code, with no luck:
  682.  
  683.         CreateResFile( reply->fName );
  684.         resRefNum = HOpenResFile( reply->vRefNum, reply->vRefNum,
  685.                                   reply->fName, fsWrPerm );
  686.         ChangedResource( applicationVersion );
  687.         WriteResource( applicationVersion );
  688.         CloseResFile( resRefNum );
  689.  
  690. Any hints?
  691. --
  692. - -----------------------------------------------------------------
  693.  Daryl_Spitzer@mindlink.bc.ca     "Life isn't just, life just is."
  694.          a2251@mindlink.bc.ca              -- Me  (I think.)
  695.        Spitzer@UNCAMULT.BITNET
  696. - -----------------------------------------------------------------
  697.  
  698.  
  699.  
  700. - -------------------------
  701.  
  702. From: colin@Cayman.COM (Colin "Atilla" Steele)
  703. Subject:  copying a resource
  704. Date: 21 Feb 92 05:35:35 GMT
  705. Organization: Cayman Systems Inc., Cambridge, MA
  706.  
  707. In article <10192@mindlink.bc.ca> Daryl_Spitzer@mindlink.bc.ca (Daryl Spitzer) writes:
  708.  
  709.    How can I copy a single resource from one file to another?
  710.  
  711. This is off of the top of my head, but it should  go something like this.
  712.  
  713. Call Getresource to get a handle to the resource.  DetachResource to
  714. remove it from the resource map.  Lock the handle, then dup it, then
  715. DisposHandle it.  Close the resource file from which the original was
  716. taken, and open the target resource file.  Take the duped handle and
  717. call Addresource on it - this puts in back into the resource map.
  718. Now, when you close the target resource file, the resource will be put
  719. into it.
  720.  
  721. This probably ain't 100% right, but it's close - it's too late to be
  722. doing this, but, oh, well :-)
  723. --
  724.  
  725.  
  726. - ----------------------------------------------------------------------------
  727.  Colin Steele     | Cayman Systems, 26 Landsdowne St., Cambridge, MA 02139
  728.  colin@cayman.com | (617) 494-1916 x209 | applelink D0523 | Fax (617) 494-9270
  729.  
  730.  
  731.  
  732. - -------------------------
  733.  
  734. From: k044477@hobbes.kzoo.edu (Jamie R. McCarthy)
  735. Subject:  copying a resource
  736. Date: 21 Feb 92 15:55:57 GMT
  737. Organization: Kalamazoo College
  738.  
  739. colin@Cayman.COM (Colin "Atilla" Steele) writes:
  740. >Daryl_Spitzer@mindlink.bc.ca (Daryl Spitzer) writes:
  741. >>
  742. >>How can I copy a single resource from one file to another?
  743. >
  744. >Call Getresource to get a handle to the resource.  DetachResource to
  745. >remove it from the resource map.  Lock the handle, then dup it, then
  746. >DisposHandle it.  Close the resource file from which the original was
  747. >taken, and open the target resource file.  Take the duped handle and
  748. >call Addresource on it - this puts in back into the resource map.
  749. >Now, when you close the target resource file, the resource will be put
  750. >into it.
  751.  
  752. There's a few unnecessary steps in there.  AddResource() works on any
  753. old handle, but dies for resources.  But DetachResource() turns a
  754. resource into just a regular handle.
  755.  
  756. So, assuming both files are open already:
  757.  
  758. UseResFile(sourceResFileID);
  759. h = Get1Resource(sourceType, sourceID);  // h is a resource
  760. DetachResource(h);  // h is now just a plain ol' handle
  761. UseResFile(destResFileID);
  762. AddResource(h, destType, destID, destName);  // h is again a resource
  763.  
  764. ...and then close the files, if you like.
  765. -- 
  766.  Jamie McCarthy     Internet: k044477@kzoo.edu     AppleLink: j.mccarthy
  767.  Kzoo randomly kills all my mail;  if I don't acknowledge, try resending.    
  768.  
  769.  
  770.  
  771. - -------------------------
  772.  
  773. From: scott@mcl.mcl.ucsb.edu (Scott Bronson)
  774. Subject:  copying a resource
  775. Date: 23 Feb 92 02:24:27 GMT
  776.  
  777. When you go to copy the resource attributes, you may run into a stupid
  778. little logical bug that is hard to find because of its indirect results.
  779.  
  780. Consider this code (kindly taken from Jamie's previous post):
  781. Sorry if I prototyped the Set and GetResAttrs functions wrong--I'm at
  782. school now and my IMs are at home.
  783.  
  784. UseResFile(sourceResFileID);
  785. h = Get1Resource(sourceType, sourceID);  // h is a resource
  786. attrs = GetResAttrs(sourceType, sourceID);
  787. DetachResource(h);  // h is now just a plain ol' handle
  788. UseResFile(destResFileID);
  789. AddResource(h, destType, destID, destName);  // h is again a resource
  790. SetResAttrs(destType, destID, attrs);
  791.  
  792. And you are done, right?  Imagine my surprise when so simple a piece of
  793. code completely failed to save any resources to the file.  It didn't
  794. bomb or ResErr -- it just didn't do anything.
  795.  
  796. Here's the duh part.  SetResAttrs resets the ResChanged attribute, and
  797. without ResChanged, it won't be written out when the file is closed.
  798. No amount of tracing through the file manager routines found this for me.
  799. :-)
  800.  
  801. Put this right before SetResAttrs: attrs |= ResChanged; and you'll be okay.
  802.  
  803. Hope this saves you some time!
  804.  
  805.     - Scott
  806.  
  807.  
  808.  
  809. - -------------------------
  810.  
  811. From: mxmora@unix.SRI.COM (Matt Mora)
  812. Subject:  copying a resource
  813. Date: 21 Feb 92 16:46:29 GMT
  814. Organization: SRI International, Menlo Park, California
  815.  
  816. In article <10192@mindlink.bc.ca> Daryl_Spitzer@mindlink.bc.ca (Daryl Spitzer) writes:
  817. >How can I copy a single resource from one file to another?
  818. >
  819. >In particular, I want to my application to copy a resource (vers)
  820. >from itself to a data file.  I've tried this code, with no luck:
  821. >
  822. >        CreateResFile( reply->fName );
  823. >        resRefNum = HOpenResFile( reply->vRefNum, reply->vRefNum,
  824. >                                  reply->fName, fsWrPerm );
  825. >        ChangedResource( applicationVersion );
  826. >        WriteResource( applicationVersion );
  827. >        CloseResFile( resRefNum );
  828. >
  829. >Any hints?
  830.  
  831. Well here's some pseudo code:
  832.  
  833. fromrefNum=OpenResFile(fromfile);
  834. torefNum=OpenResFile(tofile);
  835. UseResFile(fromrefNum);
  836. myreshandle=Get1Resource(rType, id);
  837. DetachResource(myreshandle);
  838.  
  839. UseResFile(torefNum);
  840. /* very important to check and see if the resources you are
  841.    adding does not already exist. if it does, read it in and delete
  842.    it before you add the new one. Addres does not check to see if 
  843.    a resource with the same id is already there. it blindly adds it.
  844. */
  845.  
  846. AddResource(myreshandle, rType, id, name);
  847. /* remember that the handle you pass addresource BECOMES a resource
  848.    handle.*/
  849.  
  850. ChangedResource(myreshandle);
  851. UpdateResFile(torefNum);
  852.  
  853. -- 
  854. ___________________________________________________________
  855. Matthew Mora                |   my Mac  Matt_Mora@sri.com
  856. SRI International           |  my unix  mxmora@unix.sri.com
  857. ___________________________________________________________
  858.  
  859.  
  860.  
  861. - -------------------------
  862.  
  863. From: REEKES@applelink.apple.com (Jim Reekes)
  864. Subject:  copying a resource
  865. Date: 25 Feb 92 00:13:11 GMT
  866. Organization: Apple Computer, Inc.
  867.  
  868. In article <COLIN.92Feb21003535@wrangel.Cayman.COM>, colin@Cayman.COM (Colin "Atilla" Steele) writes:
  869. > In article <10192@mindlink.bc.ca> Daryl_Spitzer@mindlink.bc.ca (Daryl Spitzer) writes:
  870. >    How can I copy a single resource from one file to another?
  871. > This is off of the top of my head, but it should  go something like this.
  872. > Call Getresource to get a handle to the resource.  DetachResource to
  873. > remove it from the resource map.  Lock the handle, then dup it, then
  874. > DisposHandle it.  Close the resource file from which the original was
  875. > taken, and open the target resource file.  Take the duped handle and
  876. > call Addresource on it - this puts in back into the resource map.
  877. > Now, when you close the target resource file, the resource will be put
  878. > into it.
  879.  
  880. It's easier than that.  Get the original resource and detach it.  Then
  881. make sure the new targer file is the current resource file using UseResFile.
  882. Then call AddResource and UpdateResFile.
  883.  
  884.  
  885. - -----------------------------------------------------------------
  886. Jim Reekes, E.O.             |     Macintosh Toolbox Engineering
  887.                              |          Sound Manager Expert
  888. Apple Computer, Inc.         | All opinions expressed are mine, and
  889. 20525 Mariani Ave. MS: 81-EQ |  do not necessarily represent those
  890. Cupertino, CA 95014          |  of my employer, Apple Computer Inc.
  891.  
  892.  
  893.  
  894. - -------------------------
  895.  
  896. From: d88-jwa@byse.nada.kth.se (Jon W{tte)
  897. Subject:  copying a resource
  898. Date: 27 Feb 92 21:16:07 GMT
  899. Organization: Royal Institute of Technology, Stockholm, Sweden
  900.  
  901. > REEKES@applelink.apple.com (Jim Reekes) writes:
  902.  
  903.    It's easier than that.  Get the original resource and detach it.  Then
  904.    make sure the new targer file is the current resource file using UseResFile.
  905.    Then call AddResource and UpdateResFile.
  906.  
  907. You might also want to call GetResAttrs before DetachResource
  908. and SetResAttrs on the new resource - but remember to call
  909. WriteResource BEFORE that, or the resChanged attribute will be
  910. zapped.
  911.  
  912. --
  913. This Signature is distributed under the conditions of the Signature License,
  914. available at a fee from   h+@nada.kth.se  (Jon W{tte)  Reading the Signature
  915. implies that you accept to be bound by the terms in said License. Should you
  916. not agree on any of these terms, you must return the Signature unread to me.
  917.  
  918.  
  919.  
  920. - -------------------------
  921.  
  922. From: mxmora@unix.SRI.COM (Matt Mora)
  923. Subject:  copying a resource
  924. Date: 28 Feb 92 00:13:59 GMT
  925. Organization: SRI International, Menlo Park, California
  926.  
  927. In article <20729@goofy.Apple.COM> REEKES@applelink.apple.com (Jim Reekes) writes:
  928. >
  929. >It's easier than that.  Get the original resource and detach it.  Then
  930. >make sure the new targer file is the current resource file using UseResFile.
  931. >Then call AddResource and UpdateResFile.
  932.  
  933. Don't forget tho check the destination resource fork and make sure
  934. the resource id that your are adding doesn't already exist. Addresource\
  935. does not check and will blindly add as many copies as you want. 
  936.  
  937. Been burned by this.
  938.  
  939. Matt
  940.  
  941. -- 
  942. ___________________________________________________________
  943. Matthew Mora                |   my Mac  Matt_Mora@sri.com
  944. SRI International           |  my unix  mxmora@unix.sri.com
  945. ___________________________________________________________
  946.  
  947.  
  948.  
  949. ---------------------------
  950.  
  951. From: rcs91900@zach.fit.edu Charles Stockman
  952. Subject: How do you get SFGetFile() to show *.sic only
  953. Date: 20 Feb 92 23:40:44 GMT
  954. Organization: Florida Institute of Technology, ACS, Melbourne, FL
  955.  
  956. Hello 
  957.  
  958. I am wondering, how would you tell SFGetFile() (macs built in directory
  959. requestor) that you only want to show files with the extension .sic 
  960.  
  961. Thanks a lot
  962.  
  963.  
  964.  
  965. - -------------------------
  966.  
  967. From: mcmath@csb1.nlm.nih.gov (Chuck McMath)
  968. Subject:  How do you get SFGetFile() to show *.sic only
  969. Date: 21 Feb 92 12:40:41 GMT
  970. Organization: MSD
  971.  
  972. In article <3555@winnie.fit.edu>, rcs91900@zach.fit.edu Charles Stockman writes:
  973. > Hello 
  974. > I am wondering, how would you tell SFGetFile() (macs built in directory
  975. > requestor) that you only want to show files with the extension .sic 
  976. > Thanks a lot
  977.  
  978. I assume you are programming something, 'cuz if you want some off-the-shelf
  979. application to do this it ain't gonna work! :)
  980.  
  981. One parameter to SFGetFile is the fileFilter; it's a ProcPtr.  If this is
  982. not NIL, then that routine gets called for each file that is a candidate
  983. to be displayed.  Your file filter should look at the name of the file and
  984. decide if the file should be displayed.  Check Inside Mac volume I-523 and
  985. around there for more info.
  986.  
  987. Hope this helps.
  988.  
  989. chuck
  990.  
  991.                        --chuck mcmath-
  992.                     mcmath@csb1.nlm.nih.gov
  993.   MSD, Inc. * National Library of Medicine * National Institutes of Health
  994.                        Bethesda, MD 20894
  995.  
  996.  
  997.  
  998. - -------------------------
  999.  
  1000. From: ABSURD@applelink.apple.com (Tim Dierks, ToyMeister, Cray abuser)
  1001. Subject:  How do you get SFGetFile() to show *.sic only
  1002. Date: 26 Feb 92 19:29:52 GMT
  1003. Organization: MacDTS, Apple Computer
  1004.  
  1005. In article <3555@winnie.fit.edu>, rcs91900@zach.fit.edu Charles Stockman writes:
  1006. > Hello 
  1007. > I am wondering, how would you tell SFGetFile() (macs built in directory
  1008. > requestor) that you only want to show files with the extension .sic 
  1009. > Thanks a lot
  1010.  
  1011. [ If you're already familiar with all this, forgive me. ]
  1012. The first thing is that on the Mac, filename extensions are generally not used
  1013. to identify files.  Users do not expect that your program will require them
  1014. to name their files in any particular way, and you shouldn't require them to.
  1015. Instead, the Mac uses file types, identifiers invisible to the user to
  1016. identify file formats and contents.  For example, a raw text file is usually of
  1017. type 'TEXT' and a MacPaint file is of type 'MPNT'.  These types are used to
  1018. filter files in SFGetFile.
  1019.  
  1020. However, if you need to do this, you can do it with a file filter function.
  1021. Just write the function to exclude all files without the right name format.
  1022. See Inside Mac, vol I pg 524 for more info.
  1023.  
  1024. Tim Dierks
  1025. MacDTS, but I speak for myself
  1026.  
  1027.  
  1028.  
  1029. ---------------------------
  1030.  
  1031. From: tamukha@sisters.cs.uoregon.edu (Tanka R. Sunuwar)
  1032. Subject: How to store data record in file that grows dynamically?
  1033. Organization: University of Oregon Computer and Information Sciences Dept.
  1034. Date: Sat, 22 Feb 1992 09:23:58 GMT
  1035.  
  1036. Hello Mac Gurus,
  1037.  
  1038. May be this is too much to ask, but I am going to ask anyway.  I am writing
  1039. a program.  It basically stores information about customers and associated
  1040. transactions.  Since, the list of data is going to be impossible to store
  1041. in the RAM, I just store the keys in RAM and read only the necessary record
  1042. from the disk and write it back.  I have no problem with fixed size data.
  1043. However, I also need to attatch a TEHandle (mac's text handler).  Here goes
  1044. the problem:  I don't want to write whole 32K of TEHandle where actual data
  1045. is less than 32K.
  1046.  
  1047. ......|--.-----|--.---------------|--.---|....
  1048.        rec#20     rec#21           rec#22  ..... in the disk.
  1049. Now I want read rec#20, modify it and write it back.  But, when I modify
  1050. data block increases |--.--------------------------------| (looks like this)
  1051. Now how would I go about writing back rec#2 at the same place in disk without
  1052. messing up rec#21.
  1053. This is like TEXT FIELD in HyperCard, TEXT field in 4th Dimension.
  1054.  
  1055. If anybody out there have any idea, suggestion, or ftp sites where I could
  1056. get some examples of this kind, I really appreciate it. 
  1057.  
  1058. BTW, I am using THINK C 5.0.2 with TCL.  
  1059.  
  1060. Many thanks in advance.
  1061.  
  1062.  
  1063.  
  1064.  
  1065. - -------------------------
  1066.  
  1067. From: emmayche@msgate.corp.apple.com (Mark Hartman)
  1068. Subject:  How to store data record in file that grows dynamically?
  1069. Date: 26 Feb 92 18:56:40 GMT
  1070. Organization: Organization?  Who's organized?
  1071.  
  1072. In article <1992Feb22.092358.2634@cs.uoregon.edu>, tamukha@sisters.cs.uoregon.edu (Tanka R. Sunuwar) writes:
  1073. > Maybe this is too much to ask, but I am going to ask anyway.  I am writing
  1074. > a program.  It basically stores information about customers and associated
  1075. > transactions.  Since, the list of data is going to be impossible to store
  1076. > in the RAM, I just store the keys in RAM and read only the necessary record
  1077. > from the disk and write it back.  I have no problem with fixed size data.
  1078. > However, I also need to attatch a TEHandle (mac's text handler).  Here goes
  1079. > the problem:  I don't want to write whole 32K of TEHandle where actual data
  1080. > is less than 32K.
  1081. > ......|--.-----|--.---------------|--.---|....
  1082. >        rec#20     rec#21           rec#22  ..... in the disk.
  1083. > Now I want read rec#20, modify it and write it back.  But, when I modify
  1084. > data block increases |--.--------------------------------| (looks like this)
  1085. > Now how would I go about writing back rec#20 at the same place in disk
  1086. > without messing up rec#21.
  1087.  
  1088. There are several ways to accomplish this, and it depends upon some other
  1089. considerations:
  1090.  
  1091. 1) Do you want to be able to cancel a group of transactions?
  1092. 2) Are many people going to be permitted to use the file at the same time?
  1093.  
  1094. To answer your last question first, there's really no practical way to
  1095. write the record back to the same physical spot without messing up not
  1096. only record 21, but ALL subsequent records.  Obviously, since other programs
  1097. seem to do this, there must be a way to make it APPEAR as though it's in
  1098. the same physical place.
  1099.  
  1100. If you want to directly update the file, and only one person will use the
  1101. file at a time, and there's no "undo" capability needed (except one level),
  1102. I suggest that you set up the file with a structure similar to the
  1103. following (each division is 4 bytes):
  1104.  
  1105. Allocation information blocks (first one starts at byte 0 in file):
  1106.  
  1107. +-----------
  1108. | 'ALOC' in ASCII
  1109. +-----------
  1110. | Size in bytes of this block (all data including required trailing zero;
  1111. |   (size-16)/4 = n (count of records covered by this block))
  1112. +-----------
  1113. | File address (byte) of start of next allocation block, 0 if no more
  1114. +-----------
  1115. | File address (byte) of record 1
  1116. +-----------
  1117. | . . .
  1118. +-----------
  1119. | File address (byte) of record n
  1120. +-----------
  1121. | 0 (required to signal end of block, in case of corruption)
  1122. +-----------
  1123.  
  1124. Data blocks:
  1125.  
  1126. +-----------
  1127. | 'DATA' in ASCII
  1128. +-----------
  1129. | Size in bytes of this block (all data including required trailing zero)
  1130. +-----------
  1131. | All data block information goes here (not limited to 4 bytes)
  1132. +-----------
  1133. | 0 (required to signal end of block)
  1134. +-----------
  1135.  
  1136. Free blocks:
  1137.  
  1138. +-----------
  1139. | 'FREE' in ASCII
  1140. +-----------
  1141. | Size in bytes of this block (all data including required trailing zero)
  1142. +-----------
  1143. | Free space
  1144. +-----------
  1145. | 0 (required to signal end of block)
  1146. +-----------
  1147.  
  1148. Using this scheme, you would simply allocate a new data block at the end of
  1149. the file, write your information there, mark the old data as 'FREE', and
  1150. update the pointer in the allocation block to point to your new data block.
  1151. In your program's exit routine, you would traverse the 'ALOC' blocks and
  1152. gather them into one large 'ALOC' block in a new file (leaving some room
  1153. for expansion, as you desire), then copy the information from the old file
  1154. into the new file in a compact form, leaving out the 'FREE' blocks completely.
  1155.  
  1156. The overhead of this method is 16 bytes per record, plus 16 bytes for each
  1157. allocation block, which is relatively a lot, but it's a very easy structure
  1158. to implement.  Additionally, all the records will appear to be in physical
  1159. order if you access the records via the 'ALOC' pointer blocks.
  1160.  
  1161. This structure also has a LOT of expansion potential if you so desire.
  1162.  
  1163. If this doesn't do it for you, please e-mail me with your specific problems
  1164. with it and I'll try to answer them.
  1165.  
  1166. Mark Hartman, N6BMO
  1167. emmayche@msgate.corp.apple.com
  1168.  
  1169.  
  1170.  
  1171. ---------------------------
  1172.  
  1173. End of C.S.M.P. Digest
  1174. **********************
  1175.